<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>14-树形组件</title>
    <script src="../js/vue.js"></script>
    <script src="../js/jquery-3.6.0.js"></script>
    <script src="../element-ui/lib/index.js"></script>
    <link rel="stylesheet" href="../element-ui/lib/theme-chalk/index.css">
</head>
<body>
<!--1. 准备一个容器-->
<div id="app">
    <el-tree v-bind:data="treeDate">

    </el-tree>

</div>
<script>
    let vm = new Vue({
        el: "#app",
        data: {
            treeDate:[
                {
                    id:"1",
                    label:"会员管理",
                    children:[
                        { id:"10", label:"VIP会员"},
                        { id:"11", label:"非VIP会员"},
                    ]
                },
                {
                    id:"2",
                    label:"商品管理",
                    children:[
                        {
                            id:"21",
                            label: "厨具用品",
                            children:[
                                {id:"01",label:"刀具"},
                                {id:"02",label:"碗"},
                                {id:"03",label:"筷子"},
                                {id:"04",label:"清洁剂"},
                            ]
                        },
                        {
                            id:"22",
                            label:"电器用品",
                        },
                    ]
                },
            ]
        },
        methods: {},
    });
</script>

</body>
</html>